﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Globalization;
using System.Threading;

namespace IDEweek2assignment1
{
    public partial class Form1 : Form
    {
        private void ChangeLanguage(string lang)
        {
            foreach (Control c in this.Controls)
            {
                Thread.CurrentThread.CurrentUICulture = new CultureInfo(lang);
                ComponentResourceManager resources = new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo(lang));
            }
        }
        public Form1()
        {
            InitializeComponent();
        }

        private void openNewForm_button_Click(object sender, EventArgs e)
        {
            Form2 MyForm2 = new Form2();
            MyForm2.Show();
        }

        private void changeIcon_button_Click(object sender, EventArgs e)
        {
         
        }

        private void resetIcon_button_Click(object sender, EventArgs e)
        {

        }

        private void changeLanguage_button_Click(object sender, EventArgs e)
        {
            if (changeLanguage_button.Text == "Change Language")
            {
                Thread.CurrentThread.CurrentUICulture = new CultureInfo("en");
                ChangeLanguage("sr-Latn");

            }
            else
            {
                Thread.CurrentThread.CurrentUICulture = new CultureInfo("sr-Latn");
                ChangeLanguage("entfc");
            }
        }
    }
}
